package com.financing.wap.service;

import java.math.BigDecimal;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.financing.wap.common.Pager;
import com.financing.wap.dao.wherecondition.WhereCondition;
import com.financing.wap.dto.FpManagerOrder;
import com.financing.wap.dto.FpOrderCostDTO;
import com.financing.wap.dto.OrderDTO;
import com.financing.wap.dto.YouDanCommissionDTO;
import com.financing.wap.dto.YouDanOrderByProjectDTO;
import com.financing.wap.vo.OrderCountVO;
import com.financing.wap.vo.OrderDoneCountDto;
import com.financing.wap.vo.OrderResVO;
import com.financing.wap.vo.OrderVO;

/**
 * @author Mars
 * @createDate 2014年8月22日
 */
public interface IOrderService {
	
	/**
	 * 用户订单列表
	 * @param where
	 * @return
	 */
	public List<OrderDTO> getOrderList(OrderVO where);

	/**
	 * 用户订单列表数
	 * @param where
	 * @return
	 */
	public Integer getOrderListCount(OrderVO where);

	/**
	 * 机构订单列表
	 * @param where
	 * @return
	 */
	public List<OrderDTO> getCorpOrderList(OrderVO where);


	/**
	 * 机构订单列列表总数
	 * @param where
	 * @return
	 */
	public Integer getCorpOrderListCount(OrderVO where);

	public OrderDTO getOrder(String id);
	
	/**
	 * 获取订单
	 * @param where
	 * @return
	 */
	public OrderDTO getOrder(OrderVO where);
	/**
	 * 更改订单状态-已打款
	 * @param order
	 */
	public void changeOrderStatusPayConfirm(OrderDTO order);

	/**
	 * 更改订单状态-返佣确认
	 * @param order
	 */
	public void changeOrderStatusRebateConfirm(OrderDTO order);

	/**
	 * 申请预约-申请
	 * @param order
	 */
	public String applyPreOrder(OrderDTO order);
	
	/**
	 * 
	 * @Title: queryTOPOrder
	 * @Description: 查询前几笔交易 
	 * @param @param limit
	 * @param @return   
	 * @return List<OrderVO>   
	 * @throws
	 */
	public List<OrderDTO> queryTOPOrder(Integer limit);
	
	/**
	 * 
	 * @Title: countDealOrder
	 * @Description: 查询FA成交订单数 
	 * @param @param faId
	 * @param @return   
	 * @return Integer   
	 * @throws
	 */
	public Integer countDealOrder(String faId);
	/**
	 * 用户订单列表数
	 * @param where
	 * @return
	 */
	public BigDecimal getOrderAmountCount(Map<String,Object> map) throws Exception;
	
	
	/**
	 * 获取所拥有的理财师
	 * @param where
	 * @return
	 */

	public List<Integer> getSonFaidList(String corpId)throws Exception;
	/**
	 * 查询收单产品条数
	 * @param orderVo
	 * @return
	 */
	public Integer getBiddingProjectListCount(OrderVO orderVo);
	/**
	 * 查询收单产品
	 * @param where
	 * @return
	 */
	public List<YouDanOrderByProjectDTO> getBiddingProjectList(OrderVO where);

	public YouDanOrderByProjectDTO getYouDanOrderByProject(Map<String, Object> tempMap);
	/**
	 * 收单佣金总额
	 */
	public BigDecimal getMyYouDanOrderAllRebateAmount(OrderVO orderVo);

	public Integer getYouDanOrderListCount(OrderVO orderVo);

	public List<OrderDTO> getYouDanOrderList(OrderVO orderVo);

	public List<OrderCountVO> orderListCount(OrderDTO orderDto);

	
	public OrderDTO getYouDanOrderDetail(OrderVO orderVo);

	YouDanOrderByProjectDTO myBiddingProjectAmount(Map<String, Object> tempMap) throws SQLException;
	/**
	 * 查看是否是有单模式订单
	 */
	public OrderDTO preYouDanOrder(OrderDTO orderDto);
	/**
	 * 查询有单佣金信息
	 */
	public List<YouDanCommissionDTO> myBiddingProjectCommission(Map<String, Object> tempMap);
	
	public void updateOrder(OrderDTO orderDto);
	/**
	 * 出单页面
	 * 已经结佣总金额 前端、后端佣金
	 * @return
	 */
	public BigDecimal getMyOrderAllRebateAmount(OrderVO orderVo);

    public BigDecimal orderCommissionCount(String faId);

	public BigDecimal queryOrderCostCount(FpOrderCostDTO orderCost);

	public void changeOrderStatus(OrderDTO orderDto);

	public List<OrderCountVO> orderTimesCount(OrderDTO order);
	
	public List<OrderCountVO> orderTimesCountDone(OrderDTO order);
	
	/**
	 * 金策师机构版 - 订单折线图统计<预约订单+成交订单>
	 * 
	 * @param order
	 * @param fpman
	 * @return
	 */
	public List<OrderCountVO> orderCountByTimeAndOrg(OrderDTO order, FpManagerOrder fpman);
	
	/**
	 * 金策师机构版 - 订单折线图统计 <筛选全部> 横坐标获取
	 * 
	 * @param order
	 * @param fpman
	 * @return
	 */
	public List<String> queryOrderXaxisDatas(OrderDTO order, FpManagerOrder fpman);
	
	/**
	 * 金策师机构版 - 统计已成交的订单
	 * 
	 * @param order
	 * @return
	 */
	public OrderDoneCountDto queryCountOrderDone(OrderDTO order, FpManagerOrder fpman, WhereCondition wc);
	
	/**
	 * 机构版 - 查询统计已成交的订单
	 * 
	 * @param order
	 * @return
	 */
	public List<OrderResVO> queryOrderDoneByWherecondition(OrderDTO order, FpManagerOrder fpman, WhereCondition wc);

}